cmake_minimum_required(VERSION 3.5.1)

add_library( routing_topo_range  topo_range.cc)
target_link_libraries( routing_topo_range  routing_routing_gflags )

add_library( routing_topo_range_manager   topo_range_manager.cc)
target_link_libraries( routing_topo_range_manager  routing_topo_node )

add_library( routing_topo_node   topo_node.cc)
target_link_libraries( routing_topo_node   
                                            routing_topo_range
                                            cyber
                                            common_map_util
                                            routing_proto
                                            )

add_library(  routing_node_with_range   node_with_range.cc)
target_link_libraries( routing_topo_node  )


add_library( routing_topo_graph    topo_graph.cc)
target_link_libraries( routing_topo_graph
                                                routing_topo_node
                                                )

add_library(  routing_sub_topo_graph   sub_topo_graph.cc)
target_link_libraries( routing_sub_topo_graph 
                                                routing_node_with_range
                                                )


add_library( graph )
target_link_libraries(  graph   routing_sub_topo_graph
                                routing_topo_graph
                                routing_topo_range_manager)


add_library( routing_topo_test_utils  topo_test_utils.cc)
target_link_libraries( routing_topo_test_utils
                                                routing_topo_graph
                                                )

install(TARGETS     routing_topo_range
                    routing_topo_range_manager
                    routing_topo_node
                    routing_node_with_range
                    routing_topo_graph
                    routing_sub_topo_graph
                    graph
                    routing_topo_test_utils
                    
            EXPORT  apollo-export
            LIBRARY DESTINATION lib
            ARCHIVE DESTINATION lib
            RUNTIME DESTINATION bin
            INCLUDES DESTINATION .
)
